<%@page import="helpers.LanguageHelper"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="helpers.StringHelper"%>
<%@page import="java.util.TreeMap"%>
<%
String success = (String) request.getAttribute("success");
TreeMap check = (TreeMap) request.getAttribute("check");
TreeMap values = (TreeMap) request.getAttribute("values");

//Set content for seo
String nameServer = UrlHelper.getDomainServer(request);
String title = LanguageHelper.getString("contact_page") + " - " + nameServer;
String description = LanguageHelper.getString("contact_description");
String keywords = LanguageHelper.getString("keywords");
String url = UrlHelper.getServerUrl(request) + "/contact";
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/layouts/header.jsp">
	<jsp:param name="title" value="<%=title %>" />
    <jsp:param name="description" value="<%=description %>" />
    <jsp:param name="keywords" value="<%=keywords %>" />
    <jsp:param name="ogtitle" value="<%=title %>" />
    <jsp:param name="ogurl" value="<%=url %>" />
    <jsp:param name="ogdescription" value="<%=description%>" />
</jsp:include>

            <div id="mainContent" class="left">
                <div id="editArticlePage">
                	<h3 class="title"><%=LanguageHelper.getString("contact_page") %></h3>
                	<% if (success != null) { %>
                	<div class="messageBox-success"><%=success %></div>
                	<% } %>
					<form method="post" action="" class="formStyle">
						
                        <div class="left <%=check.get("name") != null ? "error" : ""%>">
                        	<label><%=LanguageHelper.getString("contact_name") %> (<%=LanguageHelper.getString("required") %>)</label>
                            <input type="text" name="name" value="<%=values.get("name") != null ? values.get("name") : "" %>"/>
                            <% if (check.get("name") != null) { %>
                            <p class="errorMessage"><%=check.get("name") %></p>
                            <% } %>
                        </div>
                        <div class="right <%=check.get("email") != null ? "error" : ""%>">
                        	<label><%=LanguageHelper.getString("contact_email") %> (<%=LanguageHelper.getString("required") %>)</label>
                            <input type="text" name="email" value="<%=values.get("email") != null ? values.get("email") : "" %>"/>
                            <% if (check.get("email") != null) { %>
                            <p class="errorMessage"><%=check.get("email") %></p>
                            <% } %>
                        </div>                                                
                        <div class="clearbreak"></div>
                        
                        <div class="keyword <%=check.get("title") != null ? "error" : ""%>">
                        	<label><%=LanguageHelper.getString("contact_title") %></label>
                            <input type="text" name="title" value="<%=values.get("title") != null ? values.get("title") : "" %>"/>
                            <% if (check.get("title") != null) { %>
                            <p class="errorMessage"><%=check.get("title") %></p>
                            <% } %>
                        </div>
                        
                        <div class="clearbreak"></div>
                        
                        <div class="<%=check.get("content") != null ? "error" : ""%>">
                        	<label><%=LanguageHelper.getString("contact_content") %> (<%=LanguageHelper.getString("required") %>)</label>
                            <textarea name="content"><%=values.get("title") != null ? values.get("title") : "" %></textarea>
                            <% if (check.get("content") != null) { %>
                            <p class="errorMessage"><%=check.get("content") %></p>
                            <% } %>
                        </div>
                        
                        <div class="keywords <%=check.get("captcha") != null ? "error" : ""%>">
                        	<label><%=LanguageHelper.getString("label_security_code") %></label>
                        	<script>
					        	var RecaptchaOptions = { theme : 'red'};
					  		</script>
							<script type="text/javascript" src="http://api.recaptcha.net/challenge?k=6LeA0c4SAAAAAMsdjrB49GPol6XImTdJM2U2AHrF"></script>
							
							<% if (check.get("captcha") != null) { %>
                            <p class="errorMessage"><%=check.get("captcha") %></p>
                            <% } %>
                        </div>
                        
                        <button type="submit"><%=LanguageHelper.getString("save") %></button>
                    </form>
                </div>
            </div>
            
            <jsp:include page="/elements/right.jsp" />
            
            <div class="clearbreak"></div>
<jsp:include page="/layouts/footer.jsp" />